<me:UIAM x:Class="WPFExcelReport.TAM21"
                    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
                    xmlns:ucd="clr-namespace:ReflectionStudio.Controls;assembly=ReflectionStudio.Controls"     
                    xmlns:me="clr-namespace:WPFExcelReport" 
                    xmlns:ex="clr-namespace:WPFExcelReport.Controls;assembly=ExControls"
                    xmlns:T="clr-namespace:WPFExcelReport;assembly=IntexBL" 
                    xmlns:AB="clr-namespace:WPFExcelReport;assembly=TICC_MKRF" 
                    xmlns:KS="clr-namespace:WPFExcelReport;assembly=TKSTSTELL" 
                    xmlns:SD="clr-namespace:WPFExcelReport;assembly=TSDDAT"  
                    xmlns:Localization="clr-namespace:Localization;assembly=Localization"
                     x:Name="TV"
                    Loaded="Window_Loaded"
     >
    <me:UIAM.Resources>
        <CollectionViewSource  x:Key="vwMaster"/>       <CollectionViewSource  x:Key="vwDetail"/>
        <ucd:Divideby1440  x:Key="day"/>
        <ucd:Divideby480  x:Key="shift"/>
        <ucd:Divideby10  x:Key="d10"/>
        <ucd:BoolToVisibilityConverter  x:Key="bv"/>
        <ucd:Divideby100  x:Key="d100"/>
        <ucd:TIMES100  x:Key="X100"/>
        <ucd:TIMES10  x:Key="X10"/>
        <ucd:Divideby1000  x:Key="d1000"/>
        <ucd:PreisConverter  x:Key="PreisConverter"/>
        <ucd:PNumConverter  x:Key="pnum"/>
        <ucd:TextTrimmingConverter  x:Key="Trim"/>
        <ucd:GB2312Convert8859P1  x:Key="gb2312"/>
    </me:UIAM.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"></RowDefinition>
            <RowDefinition Height="1*"></RowDefinition>
            <RowDefinition Height="1*"></RowDefinition>
        </Grid.RowDefinitions> 
        <WrapPanel Grid.Row="0" >
            <KS:TSKS03  KEY="{Binding  AMKST,ElementName=TV}" IsEdit="True"
                />
            <SD:K0228 KEY="{Binding AMTYP,ElementName=TV}"
                         IsEdit="True"
                          ORDERNUM="{Binding AMTYP,ElementName=TV}"
                          />
            <Button  Width="24" Height="20" Margin="10,0,0,0"  Click="QueryCommand">
                <Button.Background> 
                    <ImageBrush  ImageSource="/ImagePackage;component/Images/Search.png" />
                </Button.Background>
            </Button>
            <TextBlock VerticalAlignment="Center" Text="{Binding Source={Localization:TranslateExtension Word=查询}}"></TextBlock>
            <TextBlock Margin="10,0,0,0" Text="{Binding Source={Localization:Translate Word=机台}}" VerticalAlignment="Center" />
            <TextBox Background="White" BorderBrush="Black"    Width="24" Margin="1,0,0,0" Text="{Binding AMNRKRS,Source={StaticResource vwMaster}}" />
            <TextBox Background="White"  BorderBrush="Black"   Width="60" Margin="1,0,0,0" Text="{Binding AMLFDNR,Source={StaticResource vwMaster}}" />
            <TextBox  Background="White"  BorderBrush="Black"  Width="30"   Margin="1,0,0,0" Text="{Binding  AMPOS,Source={StaticResource vwMaster}}" />  
        </WrapPanel>
        <DataGrid  Grid.Row="1"  
                    CanUserReorderColumns="True"  
                    FontSize="12"
                    CanUserResizeRows="True" CanUserSortColumns="True"                  
                    AutoGenerateColumns="False"   
                    EnableRowVirtualization="True"  
                    RowDetailsVisibilityMode="VisibleWhenSelected" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
                    IsSynchronizedWithCurrentItem="True"  Visibility="Visible"
                   ItemsSource="{Binding Source={StaticResource ResourceKey=vwMaster}}"   
                  >
            <DataGrid.Columns>
                <DataGridTextColumn Binding="{Binding Path=AMNRKRS, Converter={StaticResource ResourceKey=Trim}}" Header=""  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=AMLFDNR}" Header="{Binding Source={Localization:TranslateExtension Word=设备}}"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=AMPOS}"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=AMBEZ, Converter={StaticResource ResourceKey=gb2312}}" Header="{Binding Source={Localization:TranslateExtension Word=说明}}"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=AMHERST}" Header="{Binding Source={Localization:Translate Word=分组}}"  Width="Auto" />
            </DataGrid.Columns>
        </DataGrid  >
        <AB:TMRILI 
             KSTKRS="{Binding KSTKRS,ElementName=TV}"
             KST="{Binding KST,ElementName=TV}"
             AMTYP="{Binding AMTYP,ElementName=TV}"
            dwAM="{Binding dwAM,ElementName=TV}"
            Grid.Row="2" /> 
    </Grid>
</me:UIAM> 
 
